package com.demo.function.skywalking;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author cyj
 **/
@Slf4j
@Service
public class SkywalkingService {

    @SneakyThrows
    @Async
    public void springAsync() {
        log.info("异步线程，当前线程名称 = " + Thread.currentThread().getName());
        Thread.sleep(500);
    }

    @SneakyThrows
    public Boolean completableFuture() {
        log.info("异步线程，当前线程名称 = " + Thread.currentThread().getName());
        Thread.sleep(500);
        return true;
    }
}
